def _u(s):
    return str(s).encode('utf-8')

class CompanyTransistor:

    @staticmethod
    def toJson(company):
        return {'id':company.id,'name':_u(company.name),'intro':_u(company.intro)}

class ProjectTransistor:
    
    @staticmethod
    def toJson(project):
        return {'id':project.id,'name':_u(project.name),'intro':_u(project.intro),'companyId' : _u(project.company_id)}

class EmployeeTransistor:
    
    @staticmethod
    def toJson(employee):
        return {'id':employee.id,'name':_u(employee.name)}
    
class DeliveryTransistor:
    
    @staticmethod
    def toJson(delivery):
        return {'id':delivery.id,'name':_u(delivery.name),'address':_u(delivery.address),'phone':_u(delivery.phone)}
    
class DishTransistor:
    
    @staticmethod
    def toJson(dish):
        return {'id':dish.id,'name':_u(dish.name),'price':dish.price}
